// stroke_extraction_2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "Tools.h"
#include "AmbigousZoneExtractor.h"

int main(int argc, char* argv[])
{
	if (argc < 2)
	{
		cerr << "Wrong input!" << endl;
		return 1;
	}
	char* input_filename = argv[1]; //"D:\\PhD\\Programs\\stroke_extraction\\Release\\test.png";

	vector<StrokeNode*> stroke_graph;
	IplImage* ambigous_zones_map;

	AmbigousZoneExtractor *extractor = new AmbigousZoneExtractor();
	extractor->run(input_filename,stroke_graph,&ambigous_zones_map);
	delete extractor;

	cvSaveImage("ambigous_zones_map.png",ambigous_zones_map);
	
	// Release stroke_graph to save memory
	for(int i = 0; i< (int) stroke_graph.size(); i++)
	{
		delete stroke_graph[i];
	}

	return 0;
}

